<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>广告管理</title>
<link href="/resource/css/bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript" src="/resource/js/jquery.min.js"></script>
<script type="text/javascript"
		src="/resource/js/bootstrap.min.js"></script>
<script src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/resource/js/jquery.form.js"></script>
</head>
<body>
<div>
	<ul class="breadcrumb" style="margin: 0px;">
		<li>系统管理</li>
		<li>广告管理</li>
		
	</ul>
</div>
<form id="advertisementform" action="/back/addadvertisement" method="post" class="form-horizontal">
	<h5 class="page-header alert-info"
		style="margin: 0px; padding: 10px; margin-bottom: 10px;">基本信息</h5>
	<!-- 开始1 -->
	<div class="row">
		<div class="col-xs-5">
			<div class="form-group ">
				<label class="col-xs-3 control-label">广告名称</label>
				<div class="col-xs-9 ">
					<input type="text" name="AdvertisementName" class="form-control" placeholder="请输入广告名称" />
				</div>
			</div>
		</div>
		<div class="col-xs-5">
			<div class="form-group ">
				<label class="col-xs-3 control-label">广告ID</label>
				<div class="col-xs-9 ">
					<input type="text" name="AdvertisementId" class="form-control" placeholder="请输入广告ID" />
				</div>
			</div>
		</div>
	</div>
	<!--结束1 -->
	<!-- 开始2 -->
	<div class="row">
		<div class="col-xs-5">
			<div class="form-group ">
				<label class="col-xs-3 control-label">广告图片</label>
				<div class="col-xs-9 ">
					<input type="file" name="upload" class="form-control" onchange="uploadImg()"/>
				</div>
			</div>
		</div>
		<div class="col-xs-5">
			<div class="form-group ">
				<label class="col-xs-3 control-label">图片预览</label>
				<div class="col-xs-9 ">
					<img alt="" id="Advertisementimg" src="" style="width:100px;height:150px;object-fit:contain">
					<input type="hidden" name="AdvertisementUrl" id="AdvertisementUrl">
				</div>
			</div>
		</div>
	</div>
	<!--结束2 -->


	<h5 class="page-header alert-info"
		style="margin: 0px; padding: 10px; margin-bottom: 10px;">广告简介</h5>
	<!-- 开始5 -->
	<div class="row">
			<div class="form-group ">
				<label class="col-xs-2 control-label">广告简介</label>
				<div class="col-xs-10 ">
					<textarea name="AdvertisementDesc" rows="" class="col-xs-12 " cols=""></textarea>
				</div>
			</div>
	</div>
	<!--结束5 -->
	
	
	<!--结束6 -->

	<div class="row">
		<div class="col-xs-3 col-xs-offset-4">
			<input type="submit" class="btn btn-success" value="添加广告" /> <input
				type="reset" class="btn btn-danger" value="重置信息" />
		</div>
	</div>

</form>
<form action="/back/deleteadvertisement">
          	<h5 class="page-header alert-info"
		              style="margin: 0px; padding: 10px; margin-bottom: 10px;">广告删除</h5>
          <input type="submit" class="btn btn-success" value="删除广告" /> 
         <div class="col-xs-4 ">
					<input type="text" name="AdvertisementId" class="form-control" placeholder="请输入广告ID" />
				</div>

</form>
<script type="text/javascript">
	function uploadImg(){
		var options={
				url:"/back/goodsinfo/uploadimg",
				type:"post",
				success:function(data){
					$("#Advertisementimg").attr("src",data);
					$("#AdvertisementUrl").val(data);
				}
		}
		$("#advertisementform").ajaxSubmit(options);
	}
</script>
</body>
</html>